Repository navigation
feat(spec)!: one-way sync-in, the spec half — datasource source, paging and delete policy keys, the pull refusals, and the synced bucket (ADR-0153) - #32118
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzj8ErM5Lipg7pHZVFA
…nisms Parse and build refusals each beside a legal twin; the synced bucket's closed affordance row, guard, reconciliation, clamp and both mirrors; readers that keep their answer skip synced; outlivesOrganization does not take it. Restores the lint mirror constant a doc edit had removed. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzj8ErM5Lipg7pHZVFA
…or sync-in Two ADR-0087 semantic entries (a sourced mapping upserts into a synced object; the _sync_ field prefix is reserved), the BREAKING changeset, and the generated docs, api surface, export origins, strictness ledger counts and liveness counts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzj8ErM5Lipg7pHZVFA
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzj8ErM5Lipg7pHZVFA
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzj8ErM5Lipg7pHZVFA
📓 Docs Drift CheckThis PR changes 5 package(s): 39 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 18 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 182 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1004696bc3bb3fb8c743aac7fb77603d07e2de6e && git checkout 1004696bc3bb3fb8c743aac7fb77603d07e2de6e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 45f0f81fb0cab0f51de2f89117cfd642d4020a16 41ae3536caaa9c7afb51033837143364d92be433 && git checkout -B drift-repro 45f0f81fb0cab0f51de2f89117cfd642d4020a16 && git merge --no-ff 41ae3536caaa9c7afb51033837143364d92be433
node scripts/docs-audit/affected-docs.mjs --json 45f0f81fb0cab0f51de2f89117cfd642d4020a16
|
|
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX Contract reviewServed-tier: Inputs read: card #32061 (body, 4 comments, the os-dev-report included), PR #32118 (body, 44 files, net diff against merge-base Check-runs on the head at the time of this record: 23 success, 9 skipped, 0 failed, 32 still in progress. Concluded green and relevant here: Check Changeset, Spec property liveness, Governed Surface Queue Guard, PR-body guards, Type Check · source gates, Type Check · debt ledger, Lint · ESLint, Lint · CI, release and engine gates, Lint · docs and code guards, Lint · repo and tooling gates, the three scoped lints, Build Docs, Build UI Deps, Dogfood Regression Gate. Pending, not judged here: Build Core, Type Check · workspace, Type Check · consumer gates, Type Check UI, Lint UI, Lint · PM dispatch-gates, Test Core 1/8 to 8/8, Test UI 1/16 to 16/16, Build and E2E UI, Live E2E UI. This verdict is the design judgment on what has concluded; the pending runs remain the gate verdicts, and a red one among them is not covered by this PASS. Type Check UI is the only measurement of the ① Derived judgments
② Semver level
Clause-②: yes (narrowing) ③ Boundary flags
Dev
④ Design judgmentNo must-fix and no should-fix. Six nits, none fixed on this head (each is outside the prose faces, so a fix would move the head): each is an accepted deviation with the follow-up named.
Implementing files
ADR-0049 judgment. The bucket does not land unenforced: the enum value arrives in the same diff as the guard set, the resolver lock that the reconciliation reads, the clamp, both mirrors and the UI union, each with a pinned test, and the two ablations on the PR body show the guard and the target refusal are load-bearing. The readers the ADR says keep their answer ( Implemented-by: VERDICT: PASS |
…m's place The closed-union pin in @object-ui/core now names synced; the spec delegation loop and the grid's bucket-lock table cover it, and the grid pins that a userActions opt-in does not re-open a synced object. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzj8ErM5Lipg7pHZVFA
…d mode on the jobs page Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzj8ErM5Lipg7pHZVFA
… upsert key Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzj8ErM5Lipg7pHZVFA
|
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX 维护者速读
席位意见:fable 契约复审 PASS(6762969887),没有必改和建议改,6 条 nit 都作为已接受偏差处理,各有去处。之后新 head 上 CI 暴露了 4 处本 PR 引起的测试红:1 处 UI 桶数钉子,3 处 CLI 夹具。卡线程已全部修好,同时把整树里 席位核对 — ACCEPT · domain:spec#3 · head
|
|
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX
State: ready + auto-merge; on MERGED the seat closes #32061, removes |
… to open userActions (objectstack-ai#33517) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XThwtS6EW9nZLU4U913YL1G)_ domain:spec#1 · os-project-manager · session_01FEkQ5p6qE7Nt8wpjSGLqiC Fixes objectstack-ai#32134 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:`managedBy: 'synced'` 对象上,注册时剥除写动词的告警和 lint 规则 `object/managed-api-method-unaffordable` 的报错/修复行,不再让作者去 `userActions` 打开写权限,改为:列出要从 `enable.apiMethods` 删掉的动词,写入走声明的 action(ADR-0153 D5)。`os explain` 多一段说明。其他 bucket 的文字逐字不变。 - 为什么改:objectstack-ai#32118 之后,`synced` 对象上 `userActions` 打开写动词会在 parse 时被拒(ADR-0153 D4)。旧文案让作者去改 `userActions`,改完构建又报错,两条信息互相矛盾,作者无路可走。 - 风险与回滚:只改文案,剥除行为、规则判定、规则 id/严重度/path、schema 都不变。回滚即还原本 PR。 - 先看:`packages/lint/src/validate-managed-api-methods.ts` 的 `writeLocked` 分支;`packages/objectql/src/registry.ts` `reconcileManagedApiMethods` 的 `remedy`。 - 两分钟验证:`pnpm --filter @objectstack/lint exec vitest run src/validate-managed-api-methods.test.ts`,预期 15 条全绿(含 synced 的两条新钉子)。 - 需要你做的:无,席位落地。 ## What changes Both sentences branch on `MANAGED_BY_WRITE_LOCKED_BUCKETS` (`@objectstack/spec/data`, today `synced` alone), the same set the parse refusal (`refuseWriteLockedUserActions`), `resolveCrudAffordances` and the core `/me/permissions` clamp already read, so the remedy text and the refusal can never disagree about which bucket is locked. - **`packages/objectql/src/registry.ts` `reconcileManagedApiMethods`.** On a write-locked bucket the warning's remedy reads: "userActions cannot open a write on this bucket (ADR-0153 D4): remove [VERBS] from enable.apiMethods and send writes through a declared action (ADR-0153 D5)." Every other bucket keeps "Declare userActions to open a verb the object legitimately takes from a user context." The rest of the line (object, bucket, stripped and kept verbs, the lint rule id) and the strip are unchanged. - **`packages/lint/src/validate-managed-api-methods.ts` (`object/managed-api-method-unaffordable`).** On a write-locked bucket the verdict reads "`enable.apiMethods` advertises [VERBS], which `managedBy: 'synced'` refuses, and `userActions` cannot open a write there, so the registry strips them", and the fix line reads "Remove [VERBS] from `enable.apiMethods`, and send writes through a declared action". Every other bucket keeps "(needs userActions …)" and both ways out. Rule id, severity, `where`, `path` and the verdict itself are unchanged. - **`packages/lint/src/rule-explanations.ts`.** `os explain object/managed-api-method-unaffordable` gains one paragraph: on `synced` `userActions` cannot open a write (ADR-0153 D4), so the fix line offers only the removal, and a write goes through a declared action (ADR-0153 D5). - **`.changeset/32134-synced-remedy-text.md`**: `@objectstack/objectql` patch, `@objectstack/lint` patch. Both packages ship `dist/` (`files: [dist, README.md, CHANGELOG.md]`); the new text is in `packages/objectql/dist/index.js` and `packages/lint/dist/index.js` after build. **File surface.** The order named `managed-api-affordance.ts`'s `describeManagedApiMethodConflicts` as the lint sentence's source. Measured on `origin/main` `f068cde8`: the lint rule no longer reads it (it builds its own message and hint, `validate-managed-api-methods.ts` L110-114, and its CHANGELOG records the switch), and the helper has no production caller, only its own test. The seat amended the claim's surface to the lint rule, its test and the explain paragraph, and ruled the spec helper out of this PR (no parameter added to an export nobody calls). No `packages/spec` file moves, so there is no spec changeset. ## Tests - `packages/objectql/src/registry.test.ts`: a `synced` fixture pins the whole warning line; a control on `engine-owned` pins today's line byte for byte. - `packages/lint/src/validate-managed-api-methods.test.ts`: a `synced` fixture pins the whole verdict, and one with every write verb pins the whole fix line (and that it never says `userActions`); the existing exact pins on `platform` (verdict) and `better-auth` (fix line) are the controls and are unchanged. The explanation's fact list gains `ADR-0153 D4` and `ADR-0153 D5`. Both synced cases are recorded by the file's one-line, at-most-200-characters checks. <details><summary>Ablation: each synced branch forced off, red, restored (head f127667)</summary> Both suites import the subject from `src/` (`./registry`, `./validate-managed-api-methods`); `MANAGED_BY_WRITE_LOCKED_BUCKETS` comes from spec's built `dist/` and was not mutated, so no rebuild sits in either leg. ```text registry.ts: "const remedy = MANAGED_BY_WRITE_LOCKED_BUCKETS.has(managedBy)" -> "const remedy = false" anchor x1 -> x0, replacement x0 -> x1, blob eb3b6f1 -> 856148d4ab92 x on a synced object, the warning names the verbs to drop and a declared action, never userActions Tests 1 failed | 106 passed (107) ok restored: blob == HEAD (eb3b6f1) and `git diff HEAD` is empty validate-managed-api-methods.ts: "const writeLocked = MANAGED_BY_WRITE_LOCKED_BUCKETS.has(bucket);" -> "const writeLocked = false;" blob 682b98a -> 6f513b203589 x on a synced object, the verdict says userActions cannot open a write, never "needs userActions" x on a synced object, the fix line offers only the removal and a declared action Tests 2 failed | 13 passed (15) ok restored: blob == HEAD (682b98a) and `git diff HEAD` is empty ``` Control leg on the base: `registry.ts` at `f068cde8` with this PR's test file, `-t reconcileManagedApiMethods`: only the synced pin fails (Tests 1 failed | 17 passed | 89 skipped), so the engine-owned control pins the line `main` prints today. Restored, `git diff HEAD` empty. </details> ## Acceptance notes - **The spec helper still says "(needs userActions …)".** `describeManagedApiMethodConflicts` (`packages/spec/src/data/managed-api-affordance.ts` L142-150) takes only the conflicts, which carry no bucket, and nothing in the platform calls it any more. Left as it is by the seat's ruling; reported to the seat to card. - **No generated reference or skill renders either sentence.** `git grep` for the rule id and for "Declare userActions" over `skills/`, `content/` and `docs/` answers nothing, so nothing is regenerated. ## Verification On head `f127667d` (branch `claude/project-thread-88rfao`, merge base `origin/main` `f068cde8`), each exit code captured before any pipe: - `pnpm --filter @objectstack/objectql --filter @objectstack/lint test` (under the verify lock): exit 0; lint Test Files 210 passed (210), Tests 8973 passed (8973); objectql Test Files 595 passed (595), Tests 13013 passed (13013). - `pnpm --filter @objectstack/objectql --filter @objectstack/lint typecheck` (`tsc --noEmit` plus `check:test-typecheck` over `tsconfig.test.json`): exit 0, no new pinned signature ("39 file(s) / 233 error(s) / 64 pinned signature(s) held" for objectql, "2 file(s) / 6 error(s) / 2 pinned signature(s) held" for lint). - `eslint --no-inline-config` on the five changed source and test files: exit 0. - Derived gates (`node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`, 73 families): 72 exit 0; `pnpm check:dual-build-cjs-loads` exit 3 PREREQUISITE NOT MET (needs every package's `dist/`), **NOT MEASURED**, CI runs it. `--ran`: "73 derived famil(ies) accounted for — 72 run, 1 NOT-MEASURED". - `dispatch-gates --tier`: no path-derived mandate; 121 changed lines, under the 3000 threshold; no governed surface. - `origin/main` moved to `e40cd1e2` after the run; none of its commits touches the changed files or `object.zod.ts`. - CI families are read from this PR's check-runs, not re-run here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5p6qE7Nt8wpjSGLqiC Co-authored-by: Claude <noreply@anthropic.com>
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX
Requested by Yibo Wang · project thread
Fixes #32061
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #32065 (carrier note 6762847427 names skills/objectstack-data/, skills/objectstack-schema/ and the sync-in guide)
Prior rulings read: 6303358360 (#24948 letter B: stands,
syncednot added tooutlivesOrganization); ADR-0153 D1–D4 and the P2-spec row of its children table; ADR-0103 D1 (the named exception); ADR-0049; card thread: 0 rulings of 3 comments (check-prior-rulings --card 32061)Carried: #32062 (P2 engine) flips each
plannedrow (datasourceSource,connectorSource.paging,.deletePolicy,.deletedField) toliveand dropsauthorWarn, and lifts the runtimejudgeJobPullrefusal of a mapping with noconnectorSource维护者速读
datasourceSource、connectorSource.paging/deletePolicy/deletedField(均为planned+authorWarn),带源 mapping 的解析与defineStack拒绝规则,managedBy: 'synced'连同全部执行机制(写守卫、apiMethods 对账、/me/permissions钳制、两处镜像、ui 桶联合),_sync_字段名保留,security-owd-unset的 synced 修复建议。connectorSource的 mapping 必须mode: 'upsert'+upsertKey且目标对象为synced;任何对象上_sync_前缀字段被拒。两条 ADR-0087 迁移条目已登记。回滚 = revert 本 PR。packages/spec/src/stack.zod.ts#collectSourcedMappingErrors、packages/spec/src/data/mapping.zod.ts(MappingSchema 的 superRefine 和datasourceSource)、packages/spec/src/data/object.zod.ts#resolveCrudAffordances。pnpm --filter @objectstack/spec exec vitest run src/data/mapping-sync-in.test.ts src/data/object-managed-by-synced.test.ts,预期两文件全绿:每条拒绝在最小 stack 上触发,合法孪生静默。What changes
New keys (ADR-0153 D1–D3), each a
plannedliveness row underauthorWarn.mapping.datasourceSource: { object, watermark: { field, start }, full?, deletePolicy?, deletedField? }, a sibling ofconnectorSource.connectorSource.paging: { style: 'page' | 'cursor' | 'offset' | 'none', param?, nextPath? },connectorSource.deletePolicy: 'mark' | 'ignore',connectorSource.deletedField.deletePolicyhas no schema default (absence reads asmark; pinned that a parse adds no key).job.pullaccepts a mapping with either source (collectJobPullMappingErrors).Refusals, live as they land.
MappingSchemarefinement): exclusive source; a sourced mapping ismode: 'upsert'with a non-emptyupsertKey;pagingstates the parameter its style needs andnonestates none.defineStack(collectSourcedMappingErrors,STACK_CROSS_REFERENCE_INVALID/ 422): sourcedtargetObjectmust bemanagedBy: 'synced'(either source);datasourceSource.objectmust be an object of the stack and federated (external);source_key_missing;source_key_not_exact(string, or integerscale: 0withprecision≤ 15); halvablewatermark.field(datetime,date, integer number);watermark_not_exact;watermark_field_unmapped._sync_field-name reservation on any object and object extension (a second key pattern, so the published JSON Schema states it too;fieldPatchesunchanged).managedBy: 'synced'with every mechanism (ADR-0153 D4).engine-owned's;userActionsmay not open a write verb (named exception to ADR-0103 D1): refused at parse (userActions.<verb>) and closed byresolveCrudAffordancesvia the new exportedMANAGED_BY_WRITE_LOCKED_BUCKETS.ENGINE_OWNED_BUCKETS(plugin-security) takessynced, with its own 403 message.apiMethodsreconciliation strips every write method (driven by the resolver)./me/permissionsclamp:GUARDED_WRITE_BUCKETStakessynced, and reads the closed row even whenuserActionsopens a verb.PLATFORM_INTERNAL_MANAGED_BUCKETSmirrors (objectqlrule-validator.ts, lintvalidate-readonly-flow-writes.ts), each pinned against the spec enum.ui/packages/typesManagedByBucketunion andMANAGED_BY_BUCKETS.synced:user-assigned-work, bothclaim-seed-ownershippasses, the install-local seed owner.outlivesOrganizationdoes not takesynced(ruling 6303358360, [Decision] Deleting an organization once organization_id is NOT NULL: refuse while it still owns records, or delete them with it #24948 letter B, stands); pinned.Lint.
security-owd-unseton a synced object recommendssharingModel: 'public_read'(a pulled row has no person owner), or'private'with a read sharing rule.Guidance.
CONNECTOR_SOURCE_NO_POLICY:deleteModenow points atdeletePolicy.Tests
packages/spec/src/data/mapping-sync-in.test.ts(every parse and build refusal on a minimal stack beside its legal twin;job.pullwith adatasourceSource),packages/spec/src/data/object-managed-by-synced.test.ts(bucket row,userActionsrefusal and resolver clamp,_sync_reservation),packages/objectql/src/synced-outlives-organization.test.ts.system-write-guard.test.ts(member write refused, even withuserActions; system pull passes); objectqlregistry.test.ts(reconciliation offers no write method) andstatic-readonly-insert-subject-buckets.test.ts(mirror vs enum); coreeffective-object-permissions.test.ts(clamp returns the closed row withuserActions: { edit: true }) anduser-assigned-work.test.ts; lintvalidate-readonly-flow-writes.test.ts(mirror vs enum) andvalidate-security-posture.test.ts(synced fix-it); organizations and cloud-connection seed-owner tests (skipsynced).mapping-connector-source.test.ts,job-pull-organization.test.ts,object.test.ts(published key pattern).Ablation readings (
scripts/ablation-replace.mjs, restored blob == HEAD,git diff HEADempty each time):synced(system-write-guard.ts):system-write-guard.test.ts3 failed | 14 passed (17).stack.zod.ts): 3 spec files 1 failed | 56 passed (57).Acceptance notes
security-owd-unsetfix-it in this child; no child row of ADR-0153 places the warning. It needs a home (likely the P3 guide/Studio child or a lint card).watermark_field_unmappedat build is judged fordatasourceSourceonly. A connector source's watermark is a response path, not a field of a stack object, so the build cannot type it; the executor's runtime check stays.source_key_missing, …) are finding names inside theSTACK_CROSS_REFERENCE_INVALIDenvelope, like the executor's reasons, so no ADR-0112 code was registered.Also:
ui/packages/app-shell/src/components/ManagedByBadge.tsx(private, not in the claim) needed a one-line type exclusion so the console compiles with the new bucket; its badge forsyncedis left to the Studio child. ADR-0153's status line still reads Proposed.Verification
Derived gates: 129 derived, 129 run, 0 NOT-MEASURED, 0 UNRUN (`dispatch-gates --ran`)
node scripts/pm/dispatch-gates.mjs --commandsderived 102 families at the first sweep and 129 after the changeset and regenerated docs joined the diff; all 129 exited 0.dist/):check-plugin-teardown-shape --self-test,check:dual-build-cjs-loads,check:i18n,pnpm --dir ui exec vitest run scripts/. After fetching the fixture commit and building the dogfood closure, each re-ran green.check-changeset-no-major --base origin/main --event <this body>: exit 0 (level axis:yes (narrowing)/narrowed, no package gradedpatch). Control, same body declaringClause-②: no/Metadata-protocol: none: exit 1.check-adr-0087-registration --base origin/main: exit 0 (registered sourced-mapping-upserts-into-synced-object, sync-field-prefix-reserved, both new here). Control, the disposition marker removed from a throwaway commit: exit 1; restored,git diff HEADempty.node scripts/check-doc-authoring.mjs: exit 0.Package tests and type checks (under os-verify-lock)
pnpm test: spec 833 files / 26541 tests (1 todo) green after the dropped-refinements header totals were corrected; lint 198 / 8384; objectql 584 / 12026; core 144 / 3274; plugin-security 256 / 6210 (45 skipped); organizations 18 / 251; cloud-connection 80 / 1178;@object-ui/types389 / 10489. All exit 0.typecheck/check:test-typecheck: spec, lint, objectql, core, plugin-security, organizations, cloud-connection,@object-ui/typestype-check: exit 0.@object-ui/app-shelltype-check, reason: theui/packages it imports are not built in this container (every@object-ui/*import unresolved, unrelated to the diff). The one edit there is a type exclusion; CI's Type Check UI lane judges it.Full dogfood battery (narrowing arm), on 988fc23
pnpm --filter '@objectstack/dogfood^...' build, thenpnpm --filter @objectstack/dogfood testunder os-verify-lock: VERDICT command-exit 0 · Test Files 446 passed, 3 skipped (449) · Tests 3695 passed, 42 skipped (3737) · no failures.Generated by Claude Code